package com.example.administrator.yunniuusedcar.holder;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.common.ui.BaseAdapterRV;
import com.example.administrator.common.ui.BaseHolderRV;
import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.adapter.MainNewInfoAdapter;
import com.example.administrator.yunniuusedcar.adapter.MainNewInfo_ButtomAdapter;
import com.example.administrator.yunniuusedcar.model.mode_benn.WZ_ArticlenListBean;
import com.example.administrator.yunniuusedcar.model.mode_benn.ZD_ArticleTopBean;
import com.squareup.picasso.Picasso;

import java.util.List;

/** 当日头条  文章列表 邦
 * Created by USER2015 on 2017/12/17.
 */

public class MainNewInfo_ButtomOnBingdHolder extends BaseHolderRV<WZ_ArticlenListBean> {

    private TextView tvInformationTitle;
    private TextView tvInformationTime;
    private ImageView ivInformationTitlePage;
    private TextView carInfo;
    private RecyclerView recyclerView04;
    private MainNewInfo_ButtomAdapter homeRanCarAdapter;

    /**
     * 构造方法
     *
     * @param context     上下文对象
     * @param parent      指RecyclerView控件
     * @param adapter     适配器
     * 1@param layoutResId RecyclerView的一个item布局文件
     */
    public MainNewInfo_ButtomOnBingdHolder(Context context, ViewGroup parent, BaseAdapterRV<WZ_ArticlenListBean> adapter) {
        super(context, parent, adapter, R.layout.fragment_choosecar02_news);
    }

    @Override
    public void onFindViews(View itemView) {
        initFindViewBid();
    }

    @Override
    protected void onRefreshView(WZ_ArticlenListBean bean, int position) {

        // 有bug 待整改
//        Picasso.with(context).load(bean.data.data.get(position).logo).into(ivInformationTitlePage);
////
//        tvInformationTitle.setText(bean.data.get(position).title);
//        tvInformationTime.setText(bean.data.get(position).add_time);
//        carInfo.setText(bean.data.get(position).desc);
    }

    private void initFindViewBid() {
        tvInformationTitle = itemView.findViewById(R.id.tv_InformationTitle);   //   列表车标题
        tvInformationTime = itemView.findViewById(R.id.tv_InformationTime);       // 时间
        ivInformationTitlePage = itemView.findViewById(R.id.iv_InformationTitlePage);   //  车LOGE
        carInfo = itemView.findViewById(R.id.tv_carInfo);   //车 描述

    }
}
